package test.design_pattern.castle_game.step3;

import java.util.HashMap;

public class Room {

    public static String NORTH = "north";
    public static String EAST = "east";
    public static String SOUTH = "south";
    public static String WEST = "west";

    private String description;
    HashMap<String, Room> exits = new HashMap<>();

    public Room(String description) {
        this.description = description;
    }


    public void setExits(String direction, Room room) {
        exits.put(direction, room);
    }

    public Room goRoom(String direction) {
        return exits.get(direction);
    }

    public String getExitDesc() {
        StringBuffer s = new StringBuffer();
        for (String key : exits.keySet()) {
            s.append(key + " ");
        }
        return s.toString();
    }

    @Override
    public String toString() {
        return description;
    }
}
